package com.wgq.IO;

import java.util.Enumeration;
import java.util.ResourceBundle;

public class GetPropertiesFile {
    public void getPropertiesFileInfo(){
        //获取文件不用加文件后缀名,否则报: java.util.MissingResourceException
        ResourceBundle rb = ResourceBundle.getBundle("test");
        Enumeration<String> Allkey = rb.getKeys();
        while (Allkey.hasMoreElements()){
            String key =   Allkey.nextElement();
            String vue = rb.getString(key);
            System.out.println(key+" --- "+vue);

        }

    }

    public String getPropertiesFileOneList(String key){
        //获取文件不用加文件后缀名,否则报: java.util.MissingResourceException
        ResourceBundle rb = ResourceBundle.getBundle("test");
        Enumeration<String> Allkey = rb.getKeys();
            return rb.getString(key);
        }



    public static void main(String[] args) {
        GetPropertiesFile g = new GetPropertiesFile();
        g.getPropertiesFileInfo();
    }
}
